#include "AVLTree.h"
#include<chrono>

int main ( int argc, char* argv[] )
{
  AvlTree<double> T;//以一个简单的double平衡树为例
  double k1, k2, N;
  std::cout<<"N = ";
  std::cin>>N;//控制树的大小，测试程序时可以小一些，验证效率时可以大一些
  
  for( double i = 0; i < N; i++ )
    T.insert(i);
  std::cout<<"k1 = ";
  std::cin>>k1;
  std::cout<<"k2 = ";
  std::cin>>k2;
  for (int i=0; i<8; i++){
  auto begin_time = std::chrono::high_resolution_clock::now();
  T.printKey( k1, k2 );
  auto end_time = std::chrono::high_resolution_clock::now();
  std::chrono::duration<double> elapsed = end_time - begin_time;
  std::cout<<"Running Time:"<<elapsed.count()<<"s\n";//<<std::endl;//统计运行时间
  }
  return 0;
}
